/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.cib.fintech.entrustedinvestment.biz.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhangqingkun
* @date 2020-09-18
**/
@Entity
@Data
@Table(name="t_transfer_order")
public class TransferOrder implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Long id;

    @Column(name = "cust_prd_code",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户产品代码")
    private String custPrdCode;

    @Column(name = "product_code")
    @ApiModelProperty(value = "托管行产品代码")
    private String productCode;

    @Column(name = "cust_prd_name")
    @ApiModelProperty(value = "客户产品名称")
    private String custPrdName;

    @Column(name = "manage_id")
    @ApiModelProperty(value = "管理人机构号")
    private String manageId;

    @Column(name = "managee_user_id")
    @ApiModelProperty(value = "管理人userid")
    private String manageeUserId;

    @Column(name = "amount")
    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @Column(name = "direction")
    @ApiModelProperty(value = "收付方向")
    private String direction;

    @Column(name = "credit_account")
    @ApiModelProperty(value = "付款账号")
    private String creditAccount;

    @Column(name = "credit_account_name")
    @ApiModelProperty(value = "付款账号名称")
    private String creditAccountName;

    @Column(name = "bank_id")
    @ApiModelProperty(value = "付款账号开户行号")
    private String bankId;

    @Column(name = "bank_name")
    @ApiModelProperty(value = "付款账号开户行名")
    private String bankName;

    @Column(name = "debit_account")
    @ApiModelProperty(value = "收款账号")
    private String debitAccount;

    @Column(name = "debit_account_name")
    @ApiModelProperty(value = "收款账号名称")
    private String debitAccountName;

    @Column(name = "fbank_id")
    @ApiModelProperty(value = "收款账号开户行号")
    private String fbankId;

    @Column(name = "fbank_name")
    @ApiModelProperty(value = "收款账号开户行名")
    private String fbankName;

    @Column(name = "payment_date")
    @ApiModelProperty(value = "指令支付日期")
    private String paymentDate;

    @Column(name = "payment_reason")
    @ApiModelProperty(value = "划款事由")
    private String paymentReason;

    @Column(name = "fuyan")
    @ApiModelProperty(value = "附言")
    private String fuyan;

    @Column(name = "payment_type_id")
    @ApiModelProperty(value = "划款类型")
    private String paymentTypeId;

    @Column(name = "cust_instruction_no")
    @ApiModelProperty(value = "流水号")
    private String custInstructionNo;

    @Column(name = "inter_bank")
    @ApiModelProperty(value = "行内外标识 可选值：1-行内支付；2-跨行支付")
    private String interBank;

    @Column(name = "zqdm")
    @ApiModelProperty(value = "证券代码")
    private String zqdm;

    @Column(name = "credit_currency")
    @ApiModelProperty(value = "付款账户币种")
    private String creditCurrency;

    @Column(name = "debit_currency")
    @ApiModelProperty(value = "收款账户币种")
    private String debitCurrency;

    @Column(name = "priority")
    @ApiModelProperty(value = "优先级 0-普通 1-高 2-紧急 3-最高")
    private String priority;

    @Column(name = "finance_product_id")
    @ApiModelProperty(value = "理财产品代码")
    private String financeProductId;

    @Column(name = "finance_product_name")
    @ApiModelProperty(value = "理财产品代码名称")
    private String financeProductName;

    @Column(name = "bz1")
    @ApiModelProperty(value = "备注1")
    private String bz1;

    @Column(name = "bz2")
    @ApiModelProperty(value = "备注2")
    private String bz2;

    @Column(name = "bz3")
    @ApiModelProperty(value = "备注3")
    private String bz3;

    @Column(name = "bz4")
    @ApiModelProperty(value = "备注4")
    private String bz4;

    @Column(name = "bz5")
    @ApiModelProperty(value = "备注5")
    private String bz5;

    @Column(name = "bz6")
    @ApiModelProperty(value = "备注6")
    private String bz6;

    @Column(name = "zltype")
    @ApiModelProperty(value = "指令模式 0未上线 1已上线")
    private String zltype;

    @Column(name = "source")
    @ApiModelProperty(value = "渠道 2-电子")
    private String source;

    @Column(name = "generate")
    @ApiModelProperty(value = "生成方式 SZT/TGT/CZXT/kfpt")
    private String generate;

    @Column(name = "ten_id")
    @ApiModelProperty(value = "租户id")
    private String tenId;

    @Column(name = "instruction_no")
    @ApiModelProperty(value = "instructionNo")
    private String instructionNo;

    @Column(name = "parent_instruction_no")
    @ApiModelProperty(value = "parentInstructionNo")
    private String parentInstructionNo;

    @Column(name = "status")
    @ApiModelProperty(value = "status")
    private Integer status;

    @Column(name = "error_message")
    @ApiModelProperty(value = "errorMessage")
    private String errorMessage;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    @Column(name = "same_city")
    @ApiModelProperty(value = "同城标志 可选值：0-否；1-是")
    private String sameCity;

    public void copy(TransferOrder source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}